package hjj.service;

import model.Dept;
import model.Duty;
import model.dept_duty_emp;
import util.Page;
import dao.impl.DeptDAOImpl;
import dao.impl.DutyDAOImpl;
import dao.impl.dept_duty_empDAOImpl;

public class DeptDutyManager {
	private dept_duty_empDAOImpl ddedi=new dept_duty_empDAOImpl();
	public Page<dept_duty_emp> getAll(int pageNo, int pageSize){
		return ddedi.getAll(pageNo, pageSize);
	}
	public Page<dept_duty_emp> getByDept(int pageNo, int pageSize,String deptname){
		DeptDAOImpl ddi=new DeptDAOImpl();
		System.out.println("deptname:"+deptname);
		Dept dept=ddi.getDeptByName(deptname);
		return ddedi.getByDept(pageNo, pageSize, dept);
	}
	public Page<dept_duty_emp> getByDuty(int pageNo, int pageSize,String dutyname){
		DutyDAOImpl ddi=new DutyDAOImpl();
		Duty duty=ddi.getDutyByName(dutyname);
		return ddedi.getByDuty(pageNo, pageSize, duty);
	}
}
